home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Games of Daze
/
Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso
/
x2ftp
/
msdos
/
mxlibs
/
sblib
/
english.sb
< prev
next >
Wrap
Text File
|
1994-07-16
|
10KB
|
416 lines
* Library for Sound Blaster control.
* Compatible with Borland C++ 3.1 and up.
* Other one ?may-be?
* Compiled in LARGE memory model.
* No recording with this BETA version.
Programmed by Jean-Francois Belleau.
(C)1994.
I've spend a lot of time on this library so i hope you will appreciate.
At this time it's a BETA version.
Sound Blaster Pro and 16 will be available soon.
Some message will be print on the screen. If you like the library, contact
me and i will send you the latest version with no message for around 20$.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Important!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Use the library at your own risk.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Important!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Contact me for any bugs, suggestions or order via:
INTERNET:
message to : djjf@biko.llc.org
Le Quebecois:
message to: Jean-Francois Belleau.
or (418)837-7199.(voice).
Mailing address is:
Jean-Francois Belleau
231 des Commandeurs,
Levis, PQ
G6V 8A7
Canada.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Availble functions:
SB_DSP,
~SB_DSP,
GetCradInfo,
GetCurrentStatus,
InitCard,
Set8BitsDma,
SetIOPort,
SetIrq,
SetOuputBuffer,
SetOuputRawHandle,
SetOuputVocHandle,
SetOuputWaveHandle,
SetSamplingRate,
SetUserFlag,
Start,
Stop.
Modules:
-cardtype.h Header file for card info.
-dma8cnt.h Header file for 8 bits DMA functions.
-dma8cnt.obj Object code for 8 bits DMA functions.
-dsp8.h Header file for low level dsp functions.
-dsp8.obj Object code for low level dsp functions.
-error.h Header file for error definitions.
-sbirq.h Header file for IRQ functions.
-sbirq.obj Object code for IRQ functions.
-sbdsp.h Header file for INTERFACE class with Sound Blaster.
-sbdsp.obj Object code for INTERFACE class with Sound Blaster.
-status.h Header file for status definitions.
-structur.h Header file for information struct.
-type.h Header file fot misc. data type.
SB_DSP:
=======
Description:
Constructor for class interface.
Entry: No parameter.
Retunr: No return.
Example:
SB_DSP *sbDspPTR;
sbDspPTR = new SB_DSP;
...
...
...
delete sbDspPTR;
------------------------------------------------------------------------------
GetCardInfo:
============
Description:
Return a struct of information for the current card.
- The struct is define in structur.h
- Never delete the pointer.
Entry: No parameter.
Return: *stc_CARD_INFO
A pointer on a struct.
Example:
SB_DSP *sbDspPTR;
stc_CARD_INFO *cardSTC;
sbDspPTR = new SB_DSP;
if( sbDspPTR->InitCard() == err_INIT_DONE )
{
cardSTC = sbDspPTR->GetCardInfo();
printf("Card name: :%s",cardSTC->cardName);
}
delete sbDspPTR;
------------------------------------------------------------------------------
GetCurrentStatus:
=================
Description:
Return the current status of the card.
Entry: No parameter.
Return:
sta_IDLE : If the card is IDLE.
sta_OUTPUT_BUFFER : If playing a buffer.
sta_OUTPUT_RAW_FILE : If playing a raw file.
sta_OUTPUT_WAVE_FILE : If playing a wave file.
sta_OUTPUT_VOC_FILE : If playing a voc file.
Example:
SB_DSP *sbDspPTR;
sbDspPTR = new SB_DSP;
if( sbDspPTR->InitCard() == err_INIT_DONE )
{
if( sbDspPTR->GetCurrentStatus() == sta_IDLE )
printf("The card is IDLE");
}
delete sbDspPTR;
------------------------------------------------------------------------------
InitCard:
=========
Description:
Initialize the card.
Important:
----------
Use functions SetIOPort, SetIrq, Set8BitsDma before using InitCard.
Entry: No parameter.
Return:
err_NO_CARD_FOUND: If no card found.
err_INIT_DONE : If the card is correctly initialized.
Example:
SB_DSP *sbDspPTR;
sbDspPTR = new SB_DSP;
sbDspPTR->SetIOPort(0x220);
sbDspPTR->SetIrq(5);
sbDspPTR->Set8BitsDma(1);
if( sbDspPTR->InitCard() == err_INIT_DONE )
printf("Card found");
else
printf("No Card found");
delete sbDspPTR;
------------------------------------------------------------------------------
Set8BitsDma:
============
Description:
Select the 8 bits DMA chanel.
Entry:
unsigned: The DMA chanel to use.
Return:
err_INVALID_DMA : If invalid chanel selected.
err_VALID_DMA : If valid chanel selected.
Example:
SB_DSP *sbDspPTR;
sbDspPTR = new SB_DSP;
if( sbDspPTR->Set8BitsDma(1) == err_VALID_DMA )
printf("Valid 8 bits DMA chanel.");
else
printf("Invalid 8 bits DMA chanel.");
delete sbDspPTR;
------------------------------------------------------------------------------
SetIOPort:
==========
Description:
Select the IO port.
Entry:
unsigned :The IO port to use.
Retour:
err_INVALID_PORT : If IO port is invalid.
err_VALID_PORT : If IO port is valid.
Example:
SB_DSP *sbDspPTR;
sbDspPTR = new SB_DSP;
if( sbDspPTR->SetIOPort(0x220) == err_VALID_PORT )
printf("Valid IO Port");
else
printf("Invalid IO Port.");
delete sbDspPTR;
------------------------------------------------------------------------------
SetIrq:
=======
Description:
Select IRQ line to be use.
Entry:
unsigned : The IRQ to use.
RETURN:
err_INVALID_IRQ : If IRQ is invalid.
err_VALID_IRQ : If IRQ is valid.
Example:
SB_DSP *sbDspPTR;
sbDspPTR = new SB_DSP;
if( sbDspPTR->SetIrq(0x220) == err_VALID_IRQ )
printf("Valid IRQ.");
else
printf("Invalid IRQ.");
delete sbDspPTR;
------------------------------------------------------------------------------
SetOutputBuffer:
================
Description:
Set the buffer to use for a buffer playback.
Length should be < 64k but no need to be aling.
If length > 64k use file playback.
NB: See SetOutputVocHandle,SetOutputWaveHandle and SetOutputRawHandle
for file playback.
Entry:
char * : The buffer.
unsigned : The buffer length.
Return:
err_INVALID_BUFFER: If buffer is NULL.
err_VALID_BUFFER : If buffer is valid.
Example:
See ex1.cpp
------------------------------------------------------------------------------
SetOutputRawHandle:
===================
Description:
Set the handle for a RAW file playback.
The file must be open with the "open" function.
Entry:
int : The file handle.
Retour:
err_INVALID_HANDLE: If invalid handle.
err_VALID_HANDLE : If valid handle.
Example:
See ex2.cpp
------------------------------------------------------------------------------
SetOutputVocHandle:
===================
Description:
Set the handle for a VOC file playback.
Only version 1.1 is supported for now.
The file must be open with the "open" function.
Entry:
int : The file handle.
Retour:
err_INVALID_HANDLE: If invalid handle.
err_VALID_HANDLE : If valid handle.
err_NOT_SUPPORTED_FILE: If not supported file.
Example:
See ex3.cpp
------------------------------------------------------------------------------
SetOutputWaveHandle:
====================
Description:
Set the handle for a WAVE file playback.
The file must be open with the "open" function.
Entry:
int : The file handle.
Retour:
err_INVALID_HANDLE: If invalid handle.
err_VALID_HANDLE : If valid handle.
err_NOT_SUPPORTED_FILE: If not supported file.
Example:
See ex4.cpp
------------------------------------------------------------------------------
SetSamplingRate:
================
Description:
Set the playback speed.
If the output is from a buffer or from a raw file you should use this
function to select the playback rate.
If the output is from a wave or a voc the speed is selected internaly.
Entry:
unsigned : The sampling rate.
Return:
err_INVALID_RATE: If the rate is too high, it is truncate to the
higher possible.
If the rate is too low, it is truncate to the
lowest possible.
err_VALID_RATE : If the rate is OK.
Example:
See ex1.cpp
------------------------------------------------------------------------------
SetUserFlag:
============
Description:
Set a flag to indicate a playback end. The value 1 is put in the flag.
Entry:
unsigned *: The flag pointer.
Return:
No return.
Example: See ex1.cpp,ex2.cpp,ex3.cpp.
------------------------------------------------------------------------------
Start:
======
Description:
Start a play back from a file or a buffer.
Entry: No parameter.
Return:
err_NO_BUFFER_SPECIFIED: If no buffer or handle specified.
err_OUTPUT_STARTED : If playing.
err_INPUT_STARTED : If recording.
Example: See ex1.cpp,ex2.cpp,ex3.cpp.
------------------------------------------------------------------------------
Stop:
=====
Description:
Stop the playback.
Entry: No parameter.
Return:
err_NOT_STARTED : If the card is IDLE.
err_OUTPUT_STOPPED: If output stopped.
err_INPUT_STOPPED : If recording stopped.
Example: See ex1.cpp,ex2.cpp,ex3.cpp.
------------------------------------------------------------------------------